package main

import (
	"html/template"
	"net/http"
)

func process(w http.ResponseWriter, r *http.Request) {
	//ParseFiles对模板文件进行分析，返回一个template类型的已经分析的模板和一个错误
	t, _ := template.ParseFiles("html/hello.html")
	//Execute 将数据应用到模板里面
	t.Execute(w, "hello world")
}

func main() {
	http.HandleFunc("/process", process)
	svr := http.Server{
		Addr:              "127.0.0.1:8080",
	}
	svr.ListenAndServe()
}
